<?php

use Illuminate\Database\Seeder;
use Faker\Factory as Faker;
use App\User;

class UserTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $faker = Faker::create();

        $user = User::create([
            "password" => $faker->password,
            "name" => "管理员",
            "email" => $faker->email,
            "avatar_file_name" => $faker->sentence,
            "avatar_file_size" => $faker->sentence,
            "avatar_content_type" => $faker->sentence,
            "avatar_updated_at" => $faker->sentence,
            "company" => $faker->company,
            "title" => $faker->title,
            "location" => $faker->city,
            "score" => 0,
            "solveNum" => 0,
            "msgcnt" => 1,
            "rank" => 0,
            "utm" => "unknown",
            "active" => 0,
            "step" => 0,
            "introduce" => null,
        ]);
        $user->id = 55;
        $user->save();

        foreach (range(1, 10) as $index) {
            User::create([
                "password" => $faker->password,
                "name" => $faker->name,
                "email" => $faker->email,
                "avatar_file_name" => $faker->sentence,
                "avatar_file_size" => $faker->sentence,
                "avatar_content_type" => $faker->sentence,
                "avatar_updated_at" => $faker->sentence,
                "company" => $faker->company,
                "title" => $faker->title,
                "location" => $faker->city,
                "score" => 0,
                "solveNum" => 0,
                "msgcnt" => 1,
                "rank" => 0,
                "utm" => "unknown",
                "active" => 0,
                "step" => 0,
                "introduce" => null,
            ]);
        }

    }
}
